#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.68])
AC_INIT([QCroqueMonster], [0.1 beta], [johan.luisier@gmail.com])
#AM_INIT_AUTOMAKE( [0.1beta] )
AC_CONFIG_SRCDIR([Tests/TestRecuperation/main.cpp])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB

AC_CHECK_PROG( HAS_QMAKE, qmake, yes, no, $PATH )
AC_CHECK_PROG( HAS_QMAKE_QT4, qmake-qt4, yes, no, $PATH )

if test x"$HAS_QMAKE" == x"yes" ;
   then
	AC_MSG_RESULT( [Found installed qmake] ) ;
   elif test x"$HAS_QMAKE_QT4" == x"yes"
   	then
		AC_MSG_RESULT( [Found installed qmake-qt4] ) ;
	else
		AC_MSG_ERROR( [Please install qmake (qmake-qt4), provided by qt-devel package.] ) ;
fi

# Checks for libraries.
# FIXME: Replace `main' with a function in `-lQtCore':
AC_CHECK_LIB([QtCore], [main])
# FIXME: Replace `main' with a function in `-lQtGui':
AC_CHECK_LIB([QtGui], [main])
# FIXME: Replace `main' with a function in `-lQtNetwork':
AC_CHECK_LIB([QtNetwork], [main])
# FIXME: Replace `main' with a function in `-lQtXml':
AC_CHECK_LIB([QtXml], [main])
# FIXME: Replace `main' with a function in `-lpthread':
AC_CHECK_LIB([pthread], [main])

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL

# Checks for library functions.
AC_FUNC_ERROR_AT_LINE

if test x"$HAS_QMAKE" == x"yes" ;
   then
	echo qmake
   else
	echo qmake-qt4
fi